set(PROJ_NAME CPPHTTPLIB)
set(LIBPROJ_NAME LIB${PROJ_NAME})
set(PROJ_LIB_NAME httplib)
set(PROJ_DIR_NAME cpp-httplib)
set(PROJ_HEADER httplib.h)

find_path(
  ${PROJ_NAME}_INCLUDE_DIR
  NAMES ${PROJ_HEADER}
  HINTS ${HJ_THIRDPARTY_PATH}/${PROJ_DIR_NAME}
  PATH_SUFFIXES include)
get_filename_component(${PROJ_NAME}_DIR ${${PROJ_NAME}_INCLUDE_DIR} DIRECTORY)
# message(STATUS "HJ_THIRDPARTY_PATH=${HJ_THIRDPARTY_PATH}, ${PROJ_NAME}_INCLUDE_DIR=${${PROJ_NAME}_INCLUDE_DIR}, ${PROJ_NAME}_DIR:${${PROJ_NAME}_DIR}")

# find_library(
#   ${PROJ_NAME}_LIB
#   NAMES ${${PROJ_NAME}_LIBRARIES} ${PROJ_LIB_NAME} lib${PROJ_LIB_NAME}
# #   HINTS ${HJ_THIRDPARTY_PATH}/${PROJ_DIR_NAME} ${HJ_THIRDPARTY_PATH}/${PROJ_DIR_NAME}/lib
#   PATH_SUFFIXES ${ARCHS_NAME})
# get_filename_component(${PROJ_NAME}_LIB_DIR ${${PROJ_NAME}_LIB} DIRECTORY)
# message(STATUS "${PROJ_NAME}_LIB=${${PROJ_NAME}_LIB} ${PROJ_NAME}_LIB_DIR=${${PROJ_NAME}_LIB_DIR}")

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(${LIBPROJ_NAME} DEFAULT_MSG ${PROJ_NAME}_INCLUDE_DIR)
mark_as_advanced(${PROJ_NAME}_INCLUDE_DIR)

if(${LIBPROJ_NAME}_FOUND)
  set(${LIBPROJ_NAME}_INCLUDE_DIRS ${${PROJ_NAME}_INCLUDE_DIR})
  # set(${LIBPROJ_NAME}_LIBRARIES ${${PROJ_NAME}_LIB})
  # message(STATUS "${LIBPROJ_NAME}_INCLUDE_DIRS=${${LIBPROJ_NAME}_INCLUDE_DIRS}, ${LIBPROJ_NAME}_LIBRARIES:${${LIBPROJ_NAME}_LIBRARIES}")

  add_library(${LIBPROJ_NAME} INTERFACE)
  # target_link_libraries(${LIBPROJ_NAME} INTERFACE ${${LIBPROJ_NAME}_LIBRARIES})
  target_include_directories(${LIBPROJ_NAME} INTERFACE ${${LIBPROJ_NAME}_INCLUDE_DIRS})
endif()
